﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
    CodeFile="NewInvoice.aspx.cs" Inherits="NewInvoice" Title="Ghasam Co. | New Invoice" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="smInvoice" runat="server" />
    <asp:UpdatePanel ID="upInvoice" RenderMode="Inline" UpdateMode="Always" runat="server">
        <ContentTemplate>
        
            <div>
                <asp:Label ID="lblMessage" ForeColor="Red" Text="" runat="server" />
            </div>
            
            <div id="formcontainer">
                <asp:Panel ID="pnlNewInvoice" Style="border: 0;" DefaultButton="btnSave" runat="server">
                    ثبت صورت حساب جدید
                    <hr />
                    <div style="padding: 5px 0">
                        <label>
                            <asp:RadioButton ID="rbCash" runat="server" OnCheckedChanged="rbCash_CheckedChanged"
                                AutoPostBack="True" GroupName="Cash" />
                            &nbsp; نقدی
                        </label>
                        <asp:TextBox ID="txtOneTimeCustomer" Enabled="false" runat="server" />
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            <asp:RadioButton ID="rbNotCash" runat="server" OnCheckedChanged="rbNotCash_CheckedChanged"
                                AutoPostBack="True" GroupName="Cash" />
                            &nbsp; نسیه
                        </label>
                        <asp:DropDownList ID="ddlCustomers" Enabled="false" runat="server" AppendDataBoundItems="True"
                            DataTextField="CustomerName" AutoPostBack="true" DataValueField="Id" OnSelectedIndexChanged="ddlCustomers_SelectedIndexChanged">
                            <asp:ListItem Value="-1">---</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            شماره کامیون</label>
                        <asp:TextBox ID="txtVehicleNumber" runat="server" />
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            وزن پر</label>
                        <asp:TextBox ID="txtGrossWeight" Text="0" runat="server" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEmptyWeight"
                            ErrorMessage="لطفا وزن را به عدد وارد کنید" runat="server" />
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            وزن خالی</label>
                        <asp:TextBox ID="txtEmptyWeight" Text="0" runat="server" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtEmptyWeight"
                            ErrorMessage="لطفا وزن را به عدد وارد کنید" runat="server" />
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            کالا</label>
                        <asp:DropDownList ID="ddlGoods" runat="server" AppendDataBoundItems="true" DataTextField="Name"
                            DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlGoods_SelectedIndexChanged">
                            <asp:ListItem Text="---" Value="-1" />
                        </asp:DropDownList>
                    </div>
                    <div style="padding: 5px 0">
                        <label>
                            وزن خالص</label>
                        <asp:TextBox ID="txtNetWeight" ReadOnly="true" runat="server" />
                        &nbsp; x &nbsp; قیمت واحد
                        <asp:TextBox ID="txtUnitPrice" ReadOnly="true" runat="server" />
                        = قیمت کل
                        <asp:TextBox ID="txtTotalPrice" ReadOnly="true" runat="server" />
                        ریال
                    </div>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    <div style="margin-top: 10px;">
       <asp:Button ID="btnSave" Text="ذخیره تغییرات" runat="server" OnClick="btnSave_Click" />
    </div>
</asp:Content>
